<form action="index.php" method="post" name="adminForm">
<script>
  jQuery(document).ready(function(){
    create_tab("#tabs");
    
    var hash = jQuery(location).attr("hash");
    if(hash != '')
      jQuery('#tabs ul li a[href="' + hash + '"]').click();
  });
</script>
<div id="tabs" style="padding-top:10px;">
  <ul>
    <? $letters = array('A', 'B' , 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); ?>
    <? foreach($letters as $letter): ?>
      <li><a href="#players-<?= $letter ?>"><?= $letter ?></a></li>      
    <? endforeach; ?>                
  </ul>

  <?  foreach($letters as $letter): ?>
    <div id="players-<?= $letter ?>">
      <?  if(isset($this->dir_players[$letter])): ?>        
        <? $players = $this->dir_players[$letter]; ?>                
        <ul class="list">
        <? $num = 1; ?>
        <? foreach($players as $player): ?>
          <? if($num > 3) $num = 1; ?>
          <li class="item<?= $num ?>">
            <a href="<?= JRoute::_('index.php?option=com_pbny&controller=players&task=display_player&id='.$player->id)?>"><?= $player->fullname ?></a>
            (<?= $player->team->abbr ?>)
          </li>      
          <? $num++; ?>
        <?  endforeach; ?>
        </ul>
        <div style="clear:both;"></div>                
      <? else: ?>      
        <h2 style="text-align:center;">No player(s) found.</h2>
      <? endif; ?>  
        <br />
    </div>  
  <?  endforeach; ?>  

</div>
<div class="clear"></div>        
</form>